/*
   Copyright (c) 2011, 2012 Mizar Tools Contributors (mizartools.org)

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
*/
/*  Contributors :
 *	2011-02-04 Marco Riccardi - initial implementation
 *  2012-05-05 Marco Riccardi - added code TOO_MANY_ELEMENTS
 *
 */
package org.mizartools.system;

import java.util.List;

import org.mizartools.utility.xml.XMLElement;

public class ElementParseException extends Exception {
 
	/**
	 */
	private static final long serialVersionUID = 4688697492092366265L;
	
	public ElementParseException(short code, String message) {
       super(message);
       this.code = code;
    }

	public ElementParseException(short code, String message, List<XMLElement> xmlElementList) {
	       super(message);
	       this.code = code;
	       this.xmlElementList = xmlElementList; 
	    }

	public List<XMLElement> getXMLElement() {
		return this.xmlElementList;
	}
	
	public short code;
	private List<XMLElement> xmlElementList;

	public static final short FILE_NOT_FOUND = 1;

	public static final short IO = 2;

	public static final short XML_STREAM = 3;

	public static final short EMPTY_FILE = 4;

	public static final short INCOMPLETE_PARSING = 5;

	public static final short NOT_VALID_FILE_EXTENSION = 6;
	
	public static final short NOT_VALID_ELEMENT = 7;

	public static final short NOT_VALID_ATTRIBUTE_ELEMENT = 8;

	public static final short DUPLICATE_ATTRIBUTE_ELEMENT = 9;
	
	public static final short NOT_VALID_TYPE_OF_ATTRIBUTE_ELEMENT = 10;
	
	public static final short UNEXPECTED_END_OF_FILE = 11;
	
	public static final short DUPLICATE_ELEMENT = 12;

	public static final short TOO_MANY_ELEMENTS = 13;
	
}
